# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

pkgname=radamsa
pkgver=0.6
pkgrel=2
pkgdesc='General purpose mutation based fuzzer'
url='https://gitlab.com/akihe/radamsa'
arch=('loong64' 'x86_64')
license=('MIT')
depends=('glibc')
makedepends=('git' 'owl-lisp')
source=(https://gitlab.com/akihe/radamsa/-/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz)
sha256sums=('a68f11da7a559fceb695a7af7035384ecd2982d666c7c95ce74c849405450b5e')
sha512sums=('4724454d28abc1fb5ab4485d685dd0f9a514146bba14e48159237306c984a694f8d5656191756edabb984ee6c3e53f317dea2fe1bac41d1625abf8d6877172bc')

prepare() {
  cd ${pkgname}-v${pkgver}
  sed -e 's/| gzip -9//' -e 's/radamsa.1.gz/radamsa.1/' -i Makefile
}

build() {
  cd ${pkgname}-v${pkgver}
  make build_radamsa CFLAGS="${CFLAGS} ${CPPFLAGS}"
}

package() {
  cd ${pkgname}-v${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENCE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
